package com.heima.wemedia.controller.feign;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.enums.AppHttpCodeEnum;
import com.heima.model.wemedia.pojos.WmNews;
import com.heima.wemedia.service.impl.WmNewsVerifyServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wmNews")
public class WmNewsPublishController {

    @Autowired
    private WmNewsVerifyServiceImpl wmNewsVerifyService;

    /**
     * 发布文章
     * @param wmNews
     * @return
     */
    @PutMapping("publish")
    public ResponseResult publish(@RequestBody WmNews wmNews){
        wmNewsVerifyService.publish(wmNews);
        return ResponseResult.okResult(AppHttpCodeEnum.SUCCESS.getCode());
    }
}
